var express = require('express');
var router = express.Router();
import api from '../api';
import upload from '../upload';
import $ from '../utils';

var authSession = $.baseFunc.authSession;

// 用户
router.post('/login',api.User.login);   //登录
router.post('/signUp',api.User.signup); //注册
router.post('/loginOut',authSession,api.User.loginOut);  //退出登录

//日志
router.post('/createDaily',authSession,api.Daily.CreateDaily); //创建日志
router.post('/deleteDaily',authSession,api.Daily.DeleteDaily); //删除日志
router.post('/getMainDaily',authSession,api.Daily.GetMainDaily); //获取日志
router.post('/getDailyDetail',authSession,api.Daily.GetDailyDetail); //根据日志ID获取日志详情

//喜欢
router.post('/setAdmire',authSession,api.Admire.SetAdmire); //点赞

//评论
router.post('/setComment',authSession,api.Comment.SetComment); //评论
router.post('/deleteComment',authSession,api.Comment.DeleteComment); //删除评论

//上传
router.post('/upload',authSession,upload.oss.uploadOne);//上传单张图片


//判断session是否有效
router.post('/checkSession',authSession,api.User.checkSession);

//用户信息
router.post('/queryUserInfo',authSession,api.User.queryUserInfo);  //获取用户信息
router.post('/changeUserInfo',authSession,api.User.changeUserInfo);  //修改用户信息









//module.exports = router;


export default router;